package io.renren.modules.app.service;

import com.baomidou.mybatisplus.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.modules.app.entity.OrderEntity;

import java.util.List;
import java.util.Map;


public interface OrderService extends IService<OrderEntity> {

    boolean addOrder(OrderEntity orderEntity);

    List<OrderEntity> selectOrders(Long userId);

    List<OrderEntity> selectOrderNotClose(Long userId);

    boolean updateOrderAccess(OrderEntity orderEntity);

    /**
     * 开始检车
     * @param orderEntity
     * @return
     */
    boolean updateOrderReceiver(OrderEntity orderEntity);

    OrderEntity getOneByOrderId(String orderId);

    PageUtils queryPage(Map<String, Object> params);

    boolean updateOrderState(String orderId,Integer state);

    boolean rejectOrder(String orderId,String reason);

    /**
     * 取消订单
     * @param orderId
     * @return
     */
    boolean cancelOrder(String orderId);

    /**
     * 完成订单
     * @param orderId
     * @return
     */
    boolean successOrder(String orderId,Long userId);

    /**
     * 更新order
     * @param orderEntity
     * @return
     */
    boolean updateOrder(OrderEntity orderEntity);
}
